package ${mapperPackage}

import ${entityPackage}.${entityName}
import org.apache.ibatis.annotations.Mapper
import org.apache.ibatis.annotations.Param


/**
* ${tableComment}(table: ${tableName}) 数据持久层
* @author ${author}
* @since ${date}
*/
@Mapper
interface ${mapperName}{

    /**
     * 单条插入新数据
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    fun insert(param: ${entityName})

    /**
     * 批量插入
     * @author ${author}
     * @since ${date}
     * @param list:
    */
    fun insertBatch(@Param("list") list: MutableList<${entityName}>)

<#if primaryColumn?? && (primaryColumn?size == 1)>
    /**
    * 根据ID删除记录
     * @author ${author}
     * @since ${date}
     * @param id:
    */
    fun deleteById(id: Any)

    /**
     * 根据ID更新记录
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    fun updateById(param: ${entityName})

    /**
     * 根据ID选择性更新
     * @author ${author}
     * @since ${date}
     * @param param:
    */
    fun updateSelectiveById(param: ${entityName})

    /**
     * 根据ID查询记录
     * @author ${author}
     * @since ${date}
     * @param id:
     * @return ${entityPackage}.${entityName}
    */
    fun selectById(id: Any): ${entityName}?

</#if>
}
